//package com.letu.mq.selector;
//
//import org.apache.rocketmq.client.producer.MessageQueueSelector;
//import org.apache.rocketmq.common.message.Message;
//import org.apache.rocketmq.common.message.MessageQueue;
//import org.springframework.stereotype.Component;
//
//import java.security.MessageDigest;
//import java.security.NoSuchAlgorithmException;
//import java.util.List;
//import java.util.Random;
//
///**
// * 顺序消息 queue选择器
// */
//@Component
//public class SeqMessageQueueSelector implements MessageQueueSelector {
//    @Override
//    public MessageQueue select(List<MessageQueue> list, Message message, Object o) {
//        //随机选择queue
//        int number = Math.abs(o.hashCode());
//        //选择consumerqueue
//        long index = number % list.size();
//        return list.get((int) index);
//    }
//}
